ceph-volume: honour osd_dmcrypt_key_size option
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 25 Jan 2022 09:25:53 +0000 (10:25 +0100)
committerBastien Roucariès <rouca@debian.org>
Mon, 22 Sep 2025 20:55:44 +0000 (22:55 +0200)
commit0fb142dc84a9985e7ddc43542086c118e6662bb8
tree0dd0a0eea204e77770fc5c2cadb158e85e458e48
parent9a6e8db3f840dd27262adfbaeaa15817929d78b8
ceph-volume: honour osd_dmcrypt_key_size option

ceph-volume doesn't honour osd_dmcrypt_key_size.
It means the default size is always applied.

It also changes the default value in `get_key_size_from_conf()`

From cryptsetup manpage:

> For XTS mode you can optionally set a key size of 512 bits with the -s option.

Using more than 512bits will end up with the following error message:

```
Key size in XTS mode must be 256 or 512 bits.
```

Fixes: https://tracker.ceph.com/issues/54006
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 47c33179f9a15ae95cc1579a421be89378602656)

origin: https://github.com/ceph/ceph/commit/f69339e00f582ec64b843ff58b66817975fca0d7
bug: https://tracker.ceph.com/issues/54006

Gbp-Pq: Name CVE-2021-3979.patch
src/ceph-volume/ceph_volume/tests/util/test_encryption.py
src/ceph-volume/ceph_volume/util/encryption.py